package com.dg.cuckoo.admin.repository;

import com.dg.cuckoo.admin.action.basicInformation.label.setLabel.OneLabel;
import com.dg.cuckoo.admin.dto.basicInformation.label.OneLabelDto;
import com.dg.cuckoo.core.BaseRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface OneLabelRepository extends BaseRepository<OneLabelDto, String> {

    OneLabelDto findByLabelName(String labelName);

    List<OneLabelDto> findOneLabelDtosByHeadLabel(Integer headLabel);

    @Query(value = "select * from one_label  limit ?,?",nativeQuery = true)
    List<OneLabelDto> page(Integer page, Integer pageSize);

    List<OneLabelDto> findByHeadLabel(Integer headLabel);

    @Query(value = "select * from one_label where head_label=1  limit ?,?",nativeQuery = true)
    List<OneLabelDto> homePage(Integer page, Integer pageSize);


}
